package com.example.daytest.manyThread;

import lombok.SneakyThrows;

/**
 * @author heyu
 * @title: MyThread2
 * @description: 继承Thread
 * @date 2022/3/11上午9:33
 */
public class MyThread2 extends Thread {



    private String name;

    @SneakyThrows
    @Override
    public void run(){

            for (int i = 0; i < 100; i++) {
                System.out.println(name + "做了" + i + "件事情");

            }



    }

    public MyThread2(String name){
        this.name=name;

    }


    public static void main(String[] args) {
        MyThread2 m1=new MyThread2("里斯本");
        MyThread2 m2=new MyThread2("要的是");
        m1.start();
        m2.start();
    }


}
